<?php
if ( !defined( "IN_OP" ) )
{
    exit( "You can't access this file directly..." );
}
$tabs_menu_list = "";
$tab_container_list = "";
$show_onLine_num_flag = true;
include_once( "class/function_3d.php" );
if ( $g_init_mode_6h )
{
    if ( $curruser['enabled'] != 2 )
    {
        $u_shareowner = get_user( $curruser['prev_id'] );
        $u_subsidary = get_user( $u_shareowner['prev_id'] );
    }
    $tabs_menu_list .= "<li {$g_only_6h}><a href=\"#tab0\" class=\"tabcolor0\" onclick=\"return false\">六合彩</a></li>";
    $tab_container_list .= "<div id=\"tab0\" class=\"tab_content\">".( "<div class=\"menuLv02\">" );
    if ( isset( $_SESSION['subaccount'] ) )
    {
        $show_onLine_num_flag = false;
        $tab_container_list .= posToMenu( L_REALTIME, "?op=agent&fp=onlinebet", "mainFrame", "onli" ).posToMenu( L_PAPER, "?op=agent&fp=paper_all", "mainFrame", "pape" ).posToMenu( "设置", "?op=agent&fp=subinfo", "mainFrame", "subi" );
    }
    else if ( $curruser['enabled'] == 2 )
    {
        $show_onLine_num_flag = false;
        $tab_container_list .= posToMenu( "报表", "?op=agent&fp=paper_all", "mainFrame", "pape" );
    }
    else if ( $u_subsidary['protmod'] == 0 )
    {
        $tab_container_list .= posToMenu( L_REALTIME, "?op=agent&fp=onlinebet", "mainFrame", "onli" ).posToMenu( "帐号管理", "?op=agent&fp=acctreeidx&gametype=0", "mainFrame", "acctreeidx" ).posToMenu( "子帐号", "?op=genagent&fp=subaccount&gametype=0", "mainFrame", "suba" ).posToMenu( L_PAPER, "?op=agent&fp=paper_all", "mainFrame", "pape" );
    }
    else
    {
        $tab_container_list .= posToMenu( L_REALTIME, "?op=agent&fp=onlinebet", "mainFrame", "onli" ).posToMenu( "走飞操盘", "?op=agent&fp=bnow1", "mainFrame", "bnow" ).posToMenu( "帐号管理", "?op=agent&fp=acctreeidx&gametype=0", "mainFrame", "acctreeidx" ).posToMenu( "子帐号", "?op=genagent&fp=subaccount&gametype=0", "mainFrame", "suba" ).posToMenu( L_PAPER, "?op=agent&fp=paper_all", "mainFrame", "pape" );
    }
	if ( !isset( $_SESSION['subaccount'] ) && $curruser['enabled'] != 2 )
    {
        $tab_container_list .= posToMenu( "信用资料", "?op=agent&fp=info", "mainFrame", "info" );
        if ( $u_subsidary['protmod'] != 0 )
        {
            $tab_container_list .= posToMenu( "注单备份", "?op=agent&fp=bet_backup", "mainFrame", "betb" );
        }
    }
    $tab_container_list .= posToMenu( "结果", "?op=agent&fp=result", "mainFrame", "resu" ).posToMenu( "规则", "?op=agent&fp=rule", "mainFrame", "rule" ).posToMenu( "登出", "?op=core&fp=logout", "_top", "logo" )."</div>";
    
    $tab_container_list .= "</div>";
}
if ( $g_init_mode_3d )
{
    foreach ( $g_gametype_3d as $i => $val )
    {
        $tabs_menu_list .= $i && $g_menu_enabled[$i] == 1 ? $g_menu_list[$i] : "";
    }
    foreach ( $g_gametype_3d as $i => $val )
    {
        if ( $g_menu_enabled[$i] == 0 || !$i )
        {
            continue;
        }
        if ( $curruser['enabled'] != 2 )
        {
            $u_shareowner = get_user( $curruser['prev_id'], $i );
            $u_subsidary = get_user( $u_shareowner['prev_id'], $i );
        }
        $bgtype = $g_gametype_3d[$i]['en'];
        $pg = $g_gametype_3d[$i]['pg'];
        $tab_container_list .= "<div id=\"tab{$i}\" class=\"tab_content\">"."<div class=\"menuLv02\">";
        if ( isset( $_SESSION['subaccount'] ) )
        {
            $show_onLine_num_flag = false;
            $tab_container_list .= posToMenu( L_REALTIME, "?op=agent&fp=onlinebet{$pg}&gametype={$i}", "mainFrame", "onli" ).posToMenu( L_PAPER, "?op=agent&fp=paper_all&gametype={$i}", "mainFrame", "pape" ).posToMenu( "设置", "?op=agent&fp=subinfo&gametype={$i}", "mainFrame", "subi" );
        }
        else if ( $curruser['enabled'] == 2 )
        {
            $show_onLine_num_flag = false;
            $tab_container_list .= posToMenu( "报表", "?op=agent&fp=paper_all&gametype={$i}", "mainFrame", "pape" );
        }
        else if ( $u_subsidary['protmod'] == 0 )
        {
            $tab_container_list .= posToMenu( L_REALTIME, "?op=agent&fp=onlinebet{$pg}&gametype={$i}", "mainFrame", "onli" ).posToMenu( "帐号管理", "?op=agent&fp=acctreeidx&gametype={$i}", "mainFrame", "acctreeidx" ).posToMenu( "子帐号", "?op=genagent&fp=subaccount&gametype={$i}", "mainFrame", "suba" ).posToMenu( L_PAPER, "?op=agent&fp=paper_all&gametype={$i}", "mainFrame", "pape" );
        }
        else
        {
            $tab_container_list .= posToMenu( L_REALTIME, "?op=agent&fp=onlinebet{$pg}&gametype={$i}", "mainFrame", "onli" ).posToMenu( "走飞操盘", "?op=agent&fp=bnow_3d&gametype={$i}", "mainFrame", "bnow" ).posToMenu( "帐号管理", "?op=agent&fp=acctreeidx&gametype={$i}", "mainFrame", "acctreeidx" ).posToMenu( "子帐号", "?op=genagent&fp=subaccount&gametype={$i}", "mainFrame", "suba" ).posToMenu( L_PAPER, "?op=agent&fp=paper_all&gametype={$i}", "mainFrame", "pape" );
        }
		if ( !isset( $_SESSION['subaccount'] ) && $curruser['enabled'] != 2 )
        {
            $tab_container_list .= posToMenu( "信用资料", "?op=agent&fp=info{$pg}&gametype={$i}", "mainFrame", "info" );
            if ( $u_subsidary['protmod'] != 0 )
            {
                $tab_container_list .= posToMenu( "注单备份", "?op=agent&fp=bet_backup{$pg}&gametype={$i}", "mainFrame", "betb" );
            }
        }
        $tab_container_list .= posToMenu( "结果", "?op=agent&fp=result{$pg}&gametype={$i}", "mainFrame", "resu" ).posToMenu( "规则", "?op=agent&fp=rule_3d&gametype={$i}", "mainFrame", "rule" ).posToMenu( "登出", "?op=core&fp=logout", "_top", "logo" )."</div>";
        
        $tab_container_list .= "</div>";
    }
}
$tmpArr = array();
foreach ( $g_gametype_3d as $gameid => $val )
{
    $tmpArr[] = QuotedStr( "op.php?op=genagent&fp=login".( 0 < $gameid ? "_3d" : "" )."&gametype={$gameid}" );
}
$linkArr = implode( ",", $tmpArr );
$ui->set( array( "tabs_menu_list" => $tabs_menu_list,"time"=>time(), "tab_container_list" => $tab_container_list, "linkArr" => $linkArr, "myInfo" => "【hi,".$aclname[$curruser['acl']]." ".$curruser['account']."】 ", "showOnLineNum" => $show_onLine_num_flag ? "<span class=\"onlineNum\"><b id=\"myOnlineNum\">线上人数</b>:&nbsp;<b class=\"onlineNum2\">0</b>&nbsp;</span>" : "", "showNolineNumJS" => $show_onLine_num_flag ? "myTimeRenewONum();" : "" ) );
?>